User Portrait Generation Method, Device, Electronic Device and Storage Medium
By generating short-term user portraits when real-time behavior data is received and long-term user portraits are generated after preset time, and using a unified computing strategy and data format, the inconsistency caused by the independence of long-term and short-term portraits is solved, real-time and comprehensive balance is achieved.
Patent Information
- Application Number
- CN202111131934.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-09-26
AI Technical Summary
In the prior art, the tasks of long-term and short-term user portraits are completely independent, resulting in independent computing logic, needing separate maintenance, and there is a problem of inconsistent long-term and short-term user portraits.
Generate short-term user portraits by receiving current real-time behavior data and generate long-term user portraits after a preset time, and use a unified computing strategy and data format to ensure consistency of long-term and short-term portraits.
It realizes the real-time and comprehensive requirements of long-term portraits, while ensuring the easy-to-maintainment of processing logic and the consistency of long-term portraits.
Smart Images

Figure CN113934928B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a method, device, electronic device and storage medium for generating user portraits. Background Art
[0002] In the prior art, it is necessary to generate user portraits by combining user behaviors, and the generated user portraits can be applied to scenarios such as personalized recommendation and search. Among them, the user portrait needs to reflect the real-time interests of users, requiring the update delay to be as small as possible; and it also needs to reflect the medium- and long-term interests of users, requiring the data to be as comprehensive as possible.
[0003] Currently, short-term portraits are processed by streaming tasks, and long-term portraits are processed by batch tasks. The inventor found that when generating user portraits in the prior art, the following problems exist:
[0004] 1. The tasks of long-term portraits and short-term portraits are completely independent, and the calculation and analysis logics are independent and need to be maintained separately; 2. Due to different data sources and calculation codes, there will be a problem that the long-term portrait and the short-term portrait are inconsistent. Summary of the Invention
[0005] Embodiments of the present invention provide a method, device, electronic device and storage medium for generating user portraits to solve the problems in the prior art that the long-term and short-term portraits are independent of each other, need to be maintained separately, and are prone to inconsistency between the long-term and short-term portraits when generating user portraits.
[0006] In the first aspect of the embodiments of the present invention, a method for generating a user portrait is provided, including:
[0007] When receiving the generated current real-time behavior data when a target user uses a target application, based on the behavior labels corresponding to the real-time behavior data in the first period and the current real-time behavior data, a first user portrait for indicating the short-term behavior preference of the target user is generated based on a target calculation strategy, and the end time of the first period is the first time when the current real-time behavior data is obtained;
[0008] At a target time, based on the behavior labels corresponding to the real-time behavior data in the second period and the real-time behavior data in a preset period, a second user portrait for indicating the long-term behavior preference of the target user is generated based on the target calculation strategy, where the target time is a time at which the time interval from the last time the second user portrait was generated is a preset duration, the end time of the second period is the start time of the preset period, the end time of the preset period is the target time, and the duration of the preset period is the preset duration;
[0009] Wherein, the duration of the second time period is greater than the preset duration, the duration of the second time period is greater than the duration of the first time period, the real-time behavior data used to generate the first user portrait and the second user portrait corresponds to the same target format, and the target calculation strategy is used to generate user portraits based on the real-time behavior data in the target format.
[0010] In the second aspect of the embodiments of the present invention, there is also provided a user portrait generation device, including:
[0011] A first generation module, configured to, when a target user uses a target application and receives the generated current real-time behavior data, generate a first user portrait indicating the short-term behavior preference of the target user based on the behavior tags corresponding to the real-time behavior data within a first time period and the current real-time behavior data according to a target calculation strategy, where the end time of the first time period is the first time for obtaining the current real-time behavior data;
[0012] A second generation module, configured to, at a target time, generate a second user portrait indicating the long-term behavior preference of the target user based on the behavior tags corresponding to the real-time behavior data within a second time period and the real-time behavior data within a preset time period according to the target calculation strategy, where the target time is a time at an interval of a preset duration from the time when the second user portrait was last generated, the end time of the second time period is the start time of the preset time period, the end time of the preset time period is the target time, and the duration of the preset time period is the preset duration;
[0013] Wherein, the duration of the second time period is greater than the preset duration, the duration of the second time period is greater than the duration of the first time period, the real-time behavior data used to generate the first user portrait and the second user portrait corresponds to the same target format, and the target calculation strategy is used to generate user portraits based on the real-time behavior data in the target format.
[0014] In the third aspect of the embodiments of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0015] The memory is used to store a computer program;
[0016] The processor is configured to, when executing the program stored in the memory, implement the above-mentioned user portrait generation method.
[0017] In the fourth aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which instructions are stored, and when the instructions run on a computer, the computer is caused to execute the above-mentioned user portrait generation method.
[0018] In a fifth aspect of the implementation of the present invention, there is also provided a computer program product containing instructions, which, when running on a computer, enables the computer to execute the above-mentioned user portrait generation method.
[0019] The embodiments of the present invention at least include the following technical effects:
[0020] In the technical solution of the present invention, when receiving the current real-time behavior data, a first user portrait is generated according to the behavior tags corresponding to the real-time behavior data in the first time period and the current real-time behavior data. When reaching the target time and meeting the trigger condition for generating the second user portrait, a second user portrait is generated according to the behavior tags corresponding to the real-time behavior data in the second time period and the real-time behavior data in the preset time period. It is possible to generate the first user portrait and the second user portrait according to different trigger conditions. Moreover, since the real-time behavior data for generating the first user portrait and the second user portrait both correspond to the same target format and the first user portrait and the second user portrait are generated based on the target calculation strategy, it is possible to achieve based on a consistent data source and a unified processing process, meet the real-time requirements of the short-term portrait and the comprehensiveness requirements of the long-term portrait, and at the same time ensure the maintainability of the processing logic and the consistency of the long-term and short-term portraits. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art.
[0022] Figure 1 Schematic diagram of the user portrait generation method provided by the embodiments of the present invention;
[0023] Figure 2 Example flowchart of generating a user portrait based on real-time behavior data provided by the embodiments of the present invention;
[0024] Figure 3 Schematic diagram of the user portrait generation device provided by the embodiments of the present invention;
[0025] Figure 4 Block diagram of the electronic device provided by the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0027] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, the "in one embodiment" or "in an embodiment" that appears throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.
[0028] In various embodiments of the present invention, it should be understood that the magnitude of the serial numbers of the following processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0029] The embodiment of the present invention provides a user portrait generation method, as Figure 1 shown, including:
[0030] Step 101, when the target user uses the target application and the generated current real-time behavior data is received, based on the behavior labels corresponding to the real-time behavior data in the first time period and the current real-time behavior data, generate a first user portrait for indicating the short-term behavior preference of the target user according to the target calculation strategy, where the end time of the first time period is the first time for obtaining the current real-time behavior data.
[0031] The user portrait generation method provided by the embodiment of the present invention can be applied to the server corresponding to the target application, or can also be applied to the terminal installed with the target application.
[0032] When the target user uses the target application, real-time behavior data will be generated. When the generated current real-time behavior data is received, the generation of the first user portrait is triggered. Among them, when generating the first user portrait, it can be generated based on the behavior labels corresponding to the real-time behavior data in the first time period and the current real-time behavior data according to the target calculation strategy. The real-time behavior data in the first time period can be understood as short-term real-time behavior data. For example, the first time period can be 3 days, 2 days or one week. According to the behavior labels corresponding to the short-term real-time behavior data and the current real-time behavior data, a first user portrait indicating the short-term behavior preference of the target user can be generated.
[0033] Based on the above description, the trigger condition for generating the first user portrait is to obtain real-time behavior data. After obtaining the current real-time behavior data, determine the first moment when the current real-time behavior data is obtained, and then, starting from the first moment, advance forward by a first duration in the time dimension to determine an initial moment. Determine the first time period based on the initial moment and the first moment. The first moment is the end moment of the first time period, and the first time period corresponds to the first duration. After determining the first time period, obtain the behavior tags corresponding to the real-time behavior data within the first time period that are pre-stored, and then generate the first user portrait according to the behavior tags corresponding to the real-time behavior data within the first time period and the current real-time behavior data by using a target calculation strategy. The short-term behavior characteristics of the target user within the target application can be determined through the generated first user portrait.
[0034] It should be noted that when generating the first user portrait at different moments, the time window lengths of the corresponding first time periods are the same, but the initial moments and end moments of the first time periods are different. For example, when real-time behavior data is obtained at 14:00 on August 7, 2021, push forward 3 days from the current moment to determine the first time period. The initial moment of the first time period is 14:00 on August 4, and the end moment is 14:00 on August 7. Then obtain the behavior tags corresponding to the real-time behavior data within the first time period, and further generate the first user portrait; when real-time behavior data is obtained at 18:00 on August 7, 2021, push forward 3 days from the current moment to determine the first time period. The initial moment of the first time period is 18:00 on August 4, and the end moment is 18:00 on August 7. Then obtain the behavior tags corresponding to the real-time behavior data within the first time period, and further generate the first user portrait.
[0035] Step 102: At the target moment, generate a second user portrait for indicating the long-term behavior preferences of the target user based on the behavior tags corresponding to the real-time behavior data within the second time period and the real-time behavior data within the preset time period, where the target moment is a moment with a preset duration interval from the time when the second user portrait was last generated. The end moment of the second time period is the initial moment of the preset time period, the end moment of the preset time period is the target moment, and the duration of the preset time period is the preset duration.
[0036] Among them, the duration of the second time period is greater than the preset duration, the duration of the second time period is greater than the duration of the first time period, the real-time behavior data used to generate the first user portrait and the second user portrait corresponds to the same target format, and the target calculation strategy is used to generate user portraits based on the real-time behavior data in the target format.
[0037] When the trigger condition for generating the second user portrait is detected, the second user portrait can be generated based on the behavior tags corresponding to the real-time behavior data within the second time period and the real-time behavior data within the preset time period according to the target calculation strategy. Among them, the trigger condition for generating the second user portrait can be: reaching the target time, that is, the current time is the target time, and the time interval between the target time and the time when the second user portrait was last generated is the preset duration.
[0038] When reaching the target time, obtain the real-time behavior data within the preset time period. The end time of the preset time period is the target time, and the duration of the preset time period is the preset duration. Therefore, based on the target time, the preset duration can be pushed forward to determine the start time of the preset time period, and then the real-time behavior data within the preset time period can be obtained. The end time of the second time period is the start time of the preset time period, that is, the second time period and the preset time period are continuous in the time dimension. When determining the second time period, based on the start time of the preset time period, the second duration is pushed forward to determine the start time of the second time period, and then the behavior tags corresponding to the real-time behavior data within the second time period are obtained. The second duration is the duration corresponding to the second time period.
[0039] Among them, the real-time behavior data corresponding to the second time period can be understood as long-term real-time behavior data. For example, the duration corresponding to the second time period can be 180 days, 270 days, or one year. According to the behavior tags corresponding to the long-term real-time behavior data and the real-time behavior data within the preset time period, the second user portrait indicating the long-term behavior preferences of the target user is generated. The preset duration corresponding to the preset time period is much less than the second duration corresponding to the second time period. For example, the preset duration corresponding to the preset time period is 1 day, and the second duration corresponding to the second time period is 360 days. And the duration of the second time period can be much greater than the duration of the first time period. The relationship between the duration of the first time period and the preset duration is not further limited here.
[0040] By counting the real-time behavior data within the preset time period, the generation of the second user portrait can be realized every preset duration (the duration corresponding to the preset time period). That is, when generating the second user portrait indicating the long-term behavior preferences of the target user, the calculation can be performed every once in a while. For example, the second user portrait is generated at 0:00 every day. At this time, the preset duration is 24 hours, and each time the second user portrait is generated, the duration of the corresponding second time period is equal.
[0041] When generating the second user portrait each time, the corresponding preset duration is the same, but the start time and end time of the preset period are different; when generating the second user portrait each time, the duration of the corresponding second period is the same, but the start time and end time of the second period are different. For example, the preset duration corresponding to the preset period is 1 day. The second user portrait is generated at 24:00 on August 6, 2021. When generating the second user portrait, the real-time behavior data of August 6 and the real-time behavior data of the previous 1 year (the end time is 0:00 on August 6, 2021) are used. The second user portrait is generated at 24:00 on August 7, 2021. When generating the second user portrait, the real-time behavior data of August 7 and the real-time behavior data of the previous 1 year (the end time is 0:00 on August 7, 2021) are used. That is, when generating the second user portrait at different times, the time window lengths of the second period and the preset period are the same, but the start time and end time of the second period are different, and the start time and end time of the preset period are different.
[0042] Among them, the trigger condition for generating the second user portrait is that the time interval from the last generation of the second user portrait reaches the preset duration. At this time, the real-time behavior data within the preset period and the behavior labels corresponding to the real-time behavior data within the second period can be obtained, and the second user portrait indicating the long-term behavior preferences of the target user is generated based on the target calculation strategy. The long-term behavior characteristics of the target user within the target application can be determined through the generated second user portrait.
[0043] Among them, the real-time behavior data for generating the first user portrait and the second user portrait corresponds to the same target format, enabling the generation of the first user portrait and the second user portrait based on the same format; the target calculation strategy is used to generate the first user portrait and the second user portrait based on the real-time behavior data in the target format. Since the calculation strategies for the first user portrait and the second user portrait are the same, user portraits can be generated based on a unified processing flow, ensuring the maintainability of the processing logic. Moreover, since the first user portrait and the second user portrait are generated based on the data source in the same format and the same calculation strategy, the consistency of the long-term and short-term portraits can be ensured.
[0044] According to the above process, the first user portrait indicating the short-term behavior preferences of the target user and the second user portrait indicating the long-term behavior preferences of the target user can be generated based on the target calculation strategy according to different trigger conditions. The user portrait generation method of the embodiments of the present invention can be applied to different scenarios, such as video recommendation scenarios, e-commerce platform product recommendation scenarios, etc. Correspondingly, the target application can be a video application, an e-commerce platform application, etc.
[0045] In the above implementation process of the present invention, when the current real-time behavior data is received, a first user portrait is generated according to the behavior tags corresponding to the real-time behavior data within the first time period and the current real-time behavior data. When the target moment is reached and the trigger condition for generating the second user portrait is met, a second user portrait is generated according to the behavior tags corresponding to the real-time behavior data within the second time period and the real-time behavior data within the preset time period. It is possible to generate the first user portrait and the second user portrait according to different trigger conditions. Moreover, since the real-time behavior data for generating the first user portrait and the second user portrait both correspond to the same target format and the first user portrait and the second user portrait are generated based on the target calculation strategy, it is possible to meet the real-time requirements of the short-term portrait and the comprehensiveness requirements of the long-term portrait based on a consistent data source and a unified processing flow. At the same time, it also ensures the easy maintainability of the processing logic and the consistency of the long-term and short-term portraits.
[0046] The process of generating the first user portrait will be introduced below. In an optional embodiment of the present invention, the generating, based on a target calculation strategy, a first user portrait for indicating the short-term behavior preferences of the target user according to the behavior tags corresponding to the real-time behavior data within the first time period and the current real-time behavior data includes:
[0047] According to the current real-time behavior data, determine the corresponding behavior tags, and obtain the tag scores of the determined behavior tags based on the target calculation strategy;
[0048] For the behavior tags corresponding to the real-time behavior data within the first time period, update the tag scores according to the target calculation strategy;
[0049] Generate a target user portrait according to the tag scores of the determined behavior tags and the updated tag scores, and the target user portrait is the first user portrait;
[0050] Wherein, each real-time behavior data corresponds to at least one of the behavior tags, and the tag contents corresponding to different behavior tags are different.
[0051] According to the target calculation strategy, the determination and update of the tag scores of the behavior tags can be performed. When generating the first user portrait, for the current real-time behavior data, the corresponding behavior tags can be determined, and then the tag scores of the behavior tags corresponding to the current real-time behavior data can be determined based on the target calculation strategy.
[0052] For the behavior tags corresponding to the real-time behavior data within the first time period, the tag scores can be updated according to the target calculation strategy. After determining the tag scores of the behavior tags corresponding to the current real-time behavior data and updating the tag scores of the behavior tags corresponding to the real-time behavior data within the first time period, a target user portrait can be generated based on the tag scores corresponding to the current real-time behavior data and the updated tag scores of the behavior tags corresponding to the real-time behavior data within the first time period. At this time, the target user portrait is the first user portrait.
[0053] Among them, for the current real-time behavior data and the real-time behavior data within the first time period, each piece of real-time behavior data can correspond to at least one behavior tag. Different behavior tags have different tag contents, and the tag scores corresponding to different behavior tags at the same moment can also be different.
[0054] The behavior tags corresponding to the real-time behavior data within the first time period are pre-determined and can be directly used at this time. For the first time period, its end time is the first time when the current real-time behavior data is obtained. For example, at 14:00 on August 7, 2021, the real-time behavior data generated by the target user when using the e-commerce application is obtained. Based on the current time, the first time period is determined by pushing 3 days forward on the time axis. The behavior tags corresponding to the real-time behavior data within the first time period are obtained, and the behavior tags are determined for the current real-time behavior data. Then, the first user portrait is generated based on the tag scores obtained from the behavior tags.
[0055] In the above implementation process of the present invention, after determining the corresponding behavior tags for the current real-time behavior data, the tag scores of the behavior tags corresponding to the current real-time behavior data can be determined according to the target calculation strategy. For the behavior tags corresponding to the real-time behavior data within the first time period, the tag scores are updated according to the target calculation strategy. Then, based on the determined tag scores and the updated tag scores, the first user portrait is generated, realizing the digital indication of the behavior preferences of the target user in the short term.
[0056] Next, the process of generating the second user portrait will be introduced. The second user portrait for indicating the long-term behavior preferences of the target user is generated based on the behavior tags corresponding to the real-time behavior data within the second time period and the real-time behavior data within the preset time period according to the target calculation strategy, including:
[0057] Determine the corresponding behavior tags according to the real-time behavior data within the preset time period, and obtain the tag scores of the determined behavior tags based on the target calculation strategy;
[0058] For the behavior tags corresponding to the real-time behavior data within the second time period, update the tag scores according to the target calculation strategy;
[0059] Generate a target user profile, which is the second user profile, based on the determined label scores of the behavior labels and the updated label scores.
[0060] Each piece of real-time behavior data corresponds to at least one of the behavior labels, and the label contents corresponding to different behavior labels are distinct.
[0061] Based on the target calculation strategy, the determination and update of the label scores of the behavior labels can be carried out. When generating the second user profile, for the real-time behavior data within a preset time period, the corresponding behavior labels can be determined, and then based on the target calculation strategy, the label scores of the behavior labels corresponding to the real-time behavior data within the preset time period can be determined.
[0062] For the behavior labels corresponding to the real-time behavior data within the second time period, the label scores can be updated according to the target calculation strategy. After determining the label scores of the behavior labels corresponding to the real-time behavior data within the preset time period and updating the label scores of the behavior labels corresponding to the real-time behavior data within the second time period, a target user profile can be generated based on the label scores of the real-time behavior data within the preset time period and the updated label scores of the real-time behavior data within the second time period. At this time, the target user profile is the second user profile.
[0063] Among them, for the real-time behavior data within the preset time period and the second time period, each piece of real-time behavior data can correspond to at least one behavior label. The label contents corresponding to different behavior labels are different, and the label scores corresponding to different behavior labels at the same moment can also be different.
[0064] Among them, the behavior labels corresponding to the real-time behavior data within the second time period are pre-determined and can be directly used at this time. For the second time period, its end time is the start time of the current preset time period. For example, obtain the real-time behavior data generated by the target user when using the e-commerce application from 0:00 to 24:00 on August 7, 2021. Based on 0:00 on August 7, 2021, determine the second time period by pushing 180 days forward on the time axis, obtain the behavior labels corresponding to the real-time behavior data within the second time period, and determine the corresponding behavior labels for the real-time behavior data within one day on August 7, 2021, and then generate the second user profile based on the behavior labels to obtain the label scores.
[0065] After determining the corresponding behavior tags for the real-time behavior data within the preset time period in the above implementation process of the present invention, the tag scores of the behavior tags can be obtained according to the target calculation strategy. For the behavior tags corresponding to the real-time behavior data within the second time period, the tag scores can be updated according to the target calculation strategy. Then, according to the determined tag scores and the updated tag scores, a second user portrait is generated, realizing the digital indication of the behavior preferences of the target user in the long term.
[0066] The process of obtaining the tag scores of the behavior tags based on the target calculation strategy is described below. The target calculation strategy is a strategy associated with behavior weights and time weights. The behavior weights are used to represent the importance of the behaviors corresponding to the real-time behavior data. The target calculation strategy includes a first calculation strategy and a second calculation strategy;
[0067] Obtaining the tag scores of the determined behavior tags based on the target calculation strategy includes:
[0068] When obtaining the tag scores of the behavior tags corresponding to the current real-time behavior data, based on the first calculation strategy, determine the behavior weights and time weights of the behavior tags corresponding to the current real-time behavior data, and determine the tag scores of the behavior tags corresponding to the current real-time behavior data according to the behavior weights and time weights of the behavior tags;
[0069] When obtaining the tag scores of the behavior tags corresponding to the real-time behavior data within the preset time period, based on the second calculation strategy, determine the behavior weights and time weights of the behavior tags corresponding to the real-time behavior data within the preset time period, and determine the tag scores of the behavior tags corresponding to the real-time behavior data within the preset time period according to the behavior weights and time weights of the behavior tags;
[0070] Among them, the calculation rules for calculating the tag scores of the first calculation strategy and the second calculation strategy are the same. The first calculation strategy includes a first rule for determining the behavior weights and a second rule for determining the time weights. The second calculation strategy includes a third rule for determining the behavior weights and a fourth rule for determining the time weights. The time interval between the collection time of the real-time behavior data and the first time and the time interval between the collection time of the real-time behavior data and the target time are both negatively correlated with the time weights. The behavior weights and the time weights are both positively correlated with the tag scores.
[0071] For a target calculation strategy, the target calculation strategy is a strategy associated with behavior weights and time weights. The behavior weight is used to represent the importance of the behavior corresponding to the real-time behavior data. The higher the importance of the real-time behavior data, the greater the corresponding weight. For example, the importance of viewing behavior data is greater than that of liking behavior data. Therefore, the weight of viewing behavior data is relatively large. The target calculation strategy includes a first calculation strategy associated with short-term real-time behavior data and a second calculation strategy associated with long-term real-time behavior data.
[0072] When obtaining the label score of the determined behavior label based on the target calculation strategy, for the case of obtaining the label score of the behavior label corresponding to the current real-time behavior data, it can be obtained according to the first calculation strategy. Since the first calculation strategy includes a first rule for determining behavior weights and a second rule for determining time weights, when obtaining the label score of the behavior label corresponding to the current real-time behavior data according to the first calculation strategy, the behavior weight of the behavior label corresponding to the current real-time behavior data can be determined based on the first rule in the first calculation strategy, and the time weight of the behavior label corresponding to the current real-time behavior data can be determined based on the second rule in the first calculation strategy. Then, the label score of the behavior label corresponding to the current real-time behavior data is determined according to the behavior weight and time weight of the behavior label. Among them, the time interval between the collection time of the real-time behavior data and the first time is negatively correlated with the time weight. Since the acquisition time of the current real-time behavior data is the first time, the time weight corresponding to the current real-time behavior data is the largest. Both the behavior weight and the time weight are positively correlated with the label score, that is, the larger the behavior weight and the time weight, the higher the label score.
[0073] When obtaining the label score of the determined behavior label based on the target calculation strategy, for the case of obtaining the label score of the behavior label corresponding to the real-time behavior data within a preset time period, it can be obtained according to the second calculation strategy. Since the second calculation strategy includes a third rule for determining behavior weights and a fourth rule for determining time weights, when obtaining the label score of the behavior label corresponding to the real-time behavior data within a preset time period according to the second calculation strategy, the behavior weight of the behavior label corresponding to the real-time behavior data within the preset time period can be determined based on the third rule in the second calculation strategy, and the time weight of the behavior label corresponding to the real-time behavior data within the preset time period can be determined based on the fourth rule in the second calculation strategy. Then, the label score of the behavior label corresponding to the real-time behavior data within the preset time period is determined according to the behavior weight and time weight of the behavior label. Among them, the time interval between the collection time of the real-time behavior data and the target time is negatively correlated with the time weight, that is, the longer the time interval between the collection time of the real-time behavior data and the target time, the smaller the corresponding time weight. Both the behavior weight and the time weight are positively correlated with the label score, that is, the larger the behavior weight and the time weight, the higher the label score.
[0074] Among them, when the first calculation strategy and the second calculation strategy determine the label score of the behavior label according to the behavior weight and time weight of the behavior label, the calculation rules for calculating the label score are the same, so as to obtain the label score based on the same calculation logic, ensuring the maintainability of the processing logic and the unity of the calculation process.
[0075] The process of updating the label score of the behavior label according to the target calculation strategy is described below. The label score update according to the target calculation strategy includes:
[0076] When updating the label score of the behavior label corresponding to the real-time behavior data in the first time period, based on the second rule included in the first calculation strategy, the time weight of the behavior label corresponding to the real-time behavior data in the first time period is re-determined, and the corresponding label score is determined according to the behavior weight of the behavior label corresponding to the real-time behavior data in the first time period and the re-determined time weight;
[0077] When updating the label score of the behavior label corresponding to the real-time behavior data in the second time period, based on the fourth rule included in the second calculation strategy, the time weight of the behavior label corresponding to the real-time behavior data in the second time period is re-determined, and the corresponding label score is determined according to the behavior weight of the behavior label corresponding to the real-time behavior data in the second time period and the re-determined time weight;
[0078] Among them, the behavior weight of the behavior label corresponding to the real-time behavior data in the first time period is determined in advance based on the first rule, and the behavior weight of the behavior label corresponding to the real-time behavior data in the second time period is determined in advance based on the third rule.
[0079] Since the target calculation strategy can determine and update the label score of the behavior label, correspondingly, the second rule included in the first calculation strategy can be used for updating the time weight, and the fourth rule included in the second calculation strategy can be used for updating the time weight. The behavior weight of the real-time behavior data does not change over time, and the behavior weights corresponding to the behavior labels of the real-time behavior data in the first time period and the second time period can be different. The behavior weight of the behavior label corresponding to the real-time behavior data in the first time period can be determined in advance based on the first rule, and the behavior weight of the behavior label corresponding to the real-time behavior data in the second time period can be determined in advance based on the third rule.
[0080] For the case of updating the label scores corresponding to the real-time behavior data within the first time period, based on the second rule, the time weights of the behavior labels corresponding to the real-time behavior data within the first time period can be re-determined. That is, for the time weights of the behavior labels corresponding to the real-time behavior data within the first time period, the time weights are updated. The update principle is: the longer the time interval between the collection time of the real-time behavior data and the first moment, the smaller the time weight. That is, the closer the collection time is to the first moment, the greater the contribution (proportion) of the real-time behavior data when generating the first user portrait. After re-determining the time weights of the behavior labels corresponding to the real-time behavior data within the first time period, for the real-time behavior data within the first time period, according to the behavior weights of the behavior labels corresponding to the real-time behavior data within the first time period and the re-determined time weights, the corresponding label scores can be determined.
[0081] For the case of updating the label scores corresponding to the real-time behavior data within the second time period, based on the fourth rule, the time weights of the behavior labels corresponding to the real-time behavior data within the second time period can be re-determined. That is, for the time weights of the behavior labels corresponding to the real-time behavior data within the second time period, the time weights are updated. The update principle is: the longer the time interval between the collection time of the real-time behavior data and the target moment, the smaller the time weight. That is, the closer the collection time is to the target moment, the greater the contribution (proportion) of the real-time behavior data when generating the second user portrait. After re-determining the time weights of the behavior labels corresponding to the real-time behavior data within the second time period, for the real-time behavior data within the second time period, according to the behavior weights of the behavior labels corresponding to the real-time behavior data within the second time period and the re-determined time weights, the corresponding label scores can be determined.
[0082] The following elaborates on the process of updating the label scores corresponding to the real-time behavior data through a specific example. For the real-time behavior data within the first time period, according to the time interval between the collection time of the real-time behavior data and the first moment, the time weights of the behavior labels corresponding to the real-time behavior data are re-determined. The behavior weights of the behavior labels of the real-time behavior data may not be updated with time. For example, the time interval between the collection time of real-time behavior data 1 and the first moment is 2 days, the updated time weight is 0.5, the behavior weight of behavior label 1 of real-time behavior data 1 is 0.9 (the corresponding behavior score is 9 points), the time interval between the collection time of real-time behavior data 2 and the first moment is 1 day, the updated time weight is 0.8, the behavior weight of behavior label 2 of real-time behavior data 2 is 0.6 (the corresponding behavior score is 6 points). Then the updated label score of behavior label 1 of real-time behavior data 1 is 9 * 0.5 = 4.5 points, and the updated label score of behavior label 2 of real-time behavior data 2 is 6 * 0.8 = 4.8 points.
[0083] In the above implementation process of the present invention, by updating the time weights of the behavior tags corresponding to the real-time behavior data in the first time period and the second time period, and re-determining the tag scores of the real-time behavior data according to the updated time weights and the pre-determined behavior weights, the tag scores can be continuously updated over time.
[0084] The process of determining the user portrait according to the tag scores is described below. Generating a target user portrait according to the determined tag scores of the behavior tags and the updated tag scores includes:
[0085] In a target data set including multiple pieces of real-time behavior data, for the behavior tags with the same tag content, accumulate the corresponding tag scores to obtain a target score;
[0086] Generate the target user portrait according to each of the target scores;
[0087] Among them, each target score corresponds to at least one behavior tag with the same tag content; the target data set includes the current real-time behavior data and the real-time behavior data in the first time period, or the target data set includes the real-time behavior data retained after data filtering in the preset time period and the real-time behavior data in the second time period.
[0088] When generating a first user portrait according to the determined tag scores of the behavior tags and the updated tag scores, in a target data set including multiple pieces of real-time behavior data, for the behavior tags with the same tag content, accumulate the corresponding tag scores to obtain a target score. At this time, the target data set includes the current real-time behavior data and the real-time behavior data in the first time period. That is, for the current real-time behavior data and the real-time behavior data in the first time period, accumulate the tag scores of the behavior tags with the same tag content to obtain a target score. The number of target scores is the number of tag contents, and each target score can correspond to at least one behavior tag with the same tag content. After obtaining multiple target scores, a first user portrait can be generated according to each target score, that is, it can be understood that a first user portrait is generated according to the tag scores of the behavior tags.
[0089] When generating the second user portrait based on the label scores of the determined behavior labels and the updated label scores, in the target data set including multiple real-time behavior data, for behavior labels with the same label content, the corresponding label scores can be accumulated to obtain the target score. At this time, the target data set includes the real-time behavior data retained after data filtering within a preset time period and the real-time behavior data within a second time period. That is, for the real-time behavior data within the preset time period, data filtering can be first performed, for example, filtering abnormal data. After data filtering, it is stored for subsequent use. Among them, for the real-time behavior data within the first time period and the second time period, data filtering can also be first performed and then stored for subsequent use. By performing data filtering, valid data can be retained, and thus the accuracy of portrait generation can be ensured. When obtaining the target score, for the real-time behavior data in the target data set, the label scores of behavior labels with the same label content can be accumulated to obtain the target score. The number of target scores is the number of label contents, and each target score can correspond to at least one behavior label with the same label content. After obtaining multiple target scores, the second user portrait can be generated according to each target score. That is, it can be understood that the second user portrait is generated according to the label scores of the behavior labels.
[0090] The process of generating the first user portrait is described below through a specific example. For example, at 15:00 on August 7, 2021, the real-time behavior data generated by the target user when using the video application is obtained. Based on the current time, the first time period is determined by pushing 3 days forward on the time axis, and the behavior labels corresponding to 3 real-time behavior data within the first time period are obtained, and at least one behavior label is determined for the currently obtained real-time behavior data. The behavior labels include but are not limited to liking videos, watching videos, forwarding videos, and collecting videos. In chronological order, for each real-time behavior data, the label score of its corresponding behavior label is determined. For example, for the first real-time behavior data, two behavior labels are obtained, and the label contents of the two behavior labels are respectively liking ancient costume videos and watching ancient costume videos; for the second real-time behavior data, four behavior labels are obtained, and the label contents of the four behavior labels are respectively forwarding modern drama videos, forwarding videos related to person A, liking videos related to person A, and liking modern drama videos; for the third real-time behavior data, three behavior labels are obtained, and the label contents of the three behavior labels are respectively liking ancient costume videos, liking videos related to person B, and watching ancient costume videos; for the fourth real-time behavior data, three behavior labels are obtained, and the label contents of the three behavior labels are respectively watching variety shows, collecting videos related to person B, and collecting variety shows.
[0091] For example, the behavior weight corresponding to liking ancient costume videos is 0.6 (the corresponding behavior score is 6 points), the behavior weight corresponding to watching ancient costume videos is 0.8 (the corresponding behavior score is 8 points), the behavior weight corresponding to forwarding modern drama videos is 0.5 (the corresponding behavior score is 5 points), the behavior weight corresponding to forwarding videos related to person A is 0.7 (the corresponding behavior score is 7 points), the behavior weight corresponding to liking videos related to person A is 0.6 (the corresponding behavior score is 6 points), the behavior weight corresponding to liking modern drama videos is 0.4 (the corresponding behavior score is 4 points), the behavior weight corresponding to liking videos related to person B is 0.6 (the corresponding behavior score is 6 points), the behavior weight corresponding to watching variety show videos is 0.9 (the corresponding behavior score is 9 points), the behavior weight corresponding to collecting videos related to person B is 0.6 (the corresponding behavior score is 6 points), and the behavior weight corresponding to collecting variety show videos is 0.8 (the corresponding behavior score is 8 points).
[0092] The time weight corresponding to the first real-time behavior data is 0.6, the time weight corresponding to the second real-time behavior data is 0.7, the time weight corresponding to the third real-time behavior data is 0.8, and the time weight corresponding to the fourth real-time behavior data is 0.9.
[0093] For the first real-time behavior data, the label score corresponding to the behavior label of liking ancient costume videos is 0.6 * 6 = 3.6 points, and the label score corresponding to the behavior label of watching ancient costume videos is 0.6 * 8 = 4.8 points. For the second real-time behavior data, the label score corresponding to the behavior label of forwarding modern drama videos is 0.7 * 5 = 3.5 points, the label score corresponding to the behavior label of forwarding videos related to person A is 0.7 * 7 = 4.9 points, the label score corresponding to the behavior label of liking videos related to person A is 0.7 * 6 = 4.2 points, and the label score corresponding to the behavior label of liking modern drama videos is 0.7 * 4 = 2.8 points. For the third real-time behavior data, the label score corresponding to the behavior label of liking ancient costume videos is 0.8 * 6 = 4.8 points, the label score corresponding to the behavior label of liking videos related to person B is 0.8 * 6 = 4.8 points, and the label score corresponding to the behavior label of watching ancient costume videos is 0.8 * 8 = 6.4 points. For the fourth real-time behavior data, the label score corresponding to the behavior label of watching variety show videos is 0.9 * 9 = 8.1 points, the label score corresponding to the behavior label of collecting videos related to person B is 0.9 * 6 = 5.4 points, and the label score corresponding to the behavior label of collecting variety show videos is 0.9 * 8 = 7.2 points.
[0094] For the behavior tag with the label content of liking ancient costume videos, the corresponding target score is 3.6 points + 4.8 points = 8.4 points; for the behavior tag with the label content of watching ancient costume videos, the corresponding target score is 4.8 points + 6.4 points = 11.2 points; for the behavior tag with the label content of forwarding modern drama videos, the corresponding target score is 3.5 points; for the behavior tag with the label content of forwarding videos related to person A, the corresponding target score is 4.9 points; for the behavior tag with the label content of liking videos related to person A, the corresponding target score is 4.2 points; for the behavior tag with the label content of liking modern drama videos, the corresponding target score is 2.8 points; for the behavior tag with the label content of liking videos related to person B, the corresponding target score is 4.8 points; for the behavior tag with the label content of watching variety show videos, the corresponding target score is 9.1 points; for the behavior tag with the label content of collecting videos related to person B, the corresponding target score is 5.4 points; for the behavior tag with the label content of collecting variety show videos, the corresponding target score is 7.2 points. Thus, the first user portrait can be generated based on multiple target scores. Here, the process of generating the second user portrait will not be exemplified.
[0095] It should be noted that the strategy of determining the tag score according to the time weight and the behavior weight is not limited to the above-listed situations. It is also possible to determine the first ratio corresponding to the time weight and the second ratio corresponding to the behavior weight, determine the time score according to the time weight, determine the behavior score according to the behavior weight, calculate the product of the first ratio and the time score, the product of the second ratio and the behavior score, and determine the tag score according to the sum of the products. Of course, those skilled in the art can also calculate the tag score through other means, which will not be listed and elaborated here.
[0096] In the above implementation process of the present invention, when generating the target user portrait, for multiple real-time behavior data in the target data set, the tag scores corresponding to the behavior tags with the same label content are accumulated to obtain the target score, and the target user portrait is generated based on each target score, which can visually indicate the behavior preferences of the target user in a digital manner.
[0097] From the above analysis, it can be seen that the preset processing flow for generating the user portrait can be summarized as: obtaining the behavior tags of the real-time behavior data, determining and updating the tag scores of the behavior tags according to the target calculation strategy, and generating the user portrait based on the tag scores of the obtained behavior tags.
[0098] In an alternative embodiment of the present invention, the method further includes:
[0099] When the target user performs various behaviors using the target application, receiving the generated real-time behavior data, and storing the received real-time behavior data after converting it into the target format.
[0100] When the target user performs various behaviors using the target application, corresponding real-time behavior data will be generated. When obtaining the real-time behavior data, the generated real-time behavior data can be received in real time through a stream processing task. For example, the real-time behavior data can be received through a Flink stream processing task, and Flink can execute any stream data program in a data parallel and pipelined manner.
[0101] When obtaining the real-time behavior data generated by the target user during the use of the target application, the current real-time behavior data can be obtained, and the short-term behavior preferences of the target user can be determined by combining the historical behavior data in the short term; or the real-time behavior data corresponding to a certain duration can be obtained, and the long-term behavior preferences of the target user can be determined by combining the historical behavior data in the long term. On the other hand, the trigger timing for determining the short-term behavior preferences of the target user is to obtain the real-time behavior data (the current real-time behavior data), and the trigger timing for determining the long-term behavior preferences of the target user is that the time interval from the last determination meets the duration condition.
[0102] By converting the received real-time behavior data into a format, the real-time behavior data corresponding to the target format can be obtained. By converting the real-time behavior data into a unified target format, it is convenient to perform calculations based on the real-time behavior data subsequently.
[0103] For the first time period and the second time period, the behavior labels corresponding to the real-time behavior data are determined based on the real-time behavior data in the target format, and the real-time behavior data within the preset time period all correspond to the target format.
[0104] The process of generating a user portrait based on the real-time behavior data in the target format is introduced below through a specific example. See Figure 2 as shown:
[0105] Step 201: Receive real-time behavior data from Kafka in real time through a Flink stream processing task.
[0106] Step 202: Convert the real-time behavior data into the target format and send it to the behavior details Kafka queue. Calculate the short-term user portrait through step 203, and calculate the long-term user portrait through steps 204 and 205.
[0107] Step 203: Receive the data in the behavior details Kafka queue through a Flink stream processing task, and calculate and store the short-term user portrait according to the received data and the historical real-time behavior data in the short term corresponding to the target format.
[0108] Step 204: Receive the data in the behavior details Kafka queue through a Flink stream processing task, filter the received data and store it.
[0109] Step 205: Through a batch task, calculate a long-term user portrait based on the stored data and historical real-time behavior data corresponding to the target format in the long term, and store it.
[0110] The above implementation process can generate long-term and short-term user portraits based on a consistent data source, ensure the consistency of long-term and short-term user portraits, and can generate more accurate user portraits, which can better provide accurate personalized services for users.
[0111] In an optional embodiment of the present invention, the method further includes:
[0112] After generating the first user portrait, store the first user portrait and establish a first association relationship between the first user portrait and the corresponding real-time behavior data;
[0113] After generating the second user portrait, store the second user portrait and establish a second association relationship between the second user portrait and the corresponding real-time behavior data;
[0114] When receiving a first query request for querying the first user portrait, in response to the first query request, obtain the corresponding real-time behavior data according to the first association relationship;
[0115] When receiving a second query request for querying the second user portrait, in response to the second query request, obtain the corresponding real-time behavior data according to the second association relationship.
[0116] After generating the first user portrait, the first user portrait can be stored, a first association relationship between the first user portrait and the corresponding real-time behavior data can be established, and the first association relationship can be stored at the same time. After generating the second user portrait, the second user portrait can be stored, a second association relationship between the second user portrait and the corresponding real-time behavior data can be established, and the second association relationship can be stored at the same time.
[0117] When receiving a first query request for querying the first user portrait, in response to the first query request, the corresponding real-time behavior data can be obtained according to the first association relationship, so as to trace and query the behavior details, enabling developers to more easily understand the first user portrait and locate online problems of the first user portrait.
[0118] When receiving a second query request for querying the second user portrait, in response to the second query request, the corresponding real-time behavior data can be obtained according to the second association relationship, so as to trace and query the behavior details, enabling developers to more easily understand the second user portrait and locate online problems of the second user portrait.
[0119] The above is the overall implementation process of the user portrait generation method provided by the embodiments of the present invention. When receiving the current real-time behavior data, a first user portrait is generated according to the behavior tags corresponding to the real-time behavior data in the first time period and the current real-time behavior data. When reaching the target moment and meeting the trigger condition for generating the second user portrait, a second user portrait is generated according to the behavior tags corresponding to the real-time behavior data in the second time period and the real-time behavior data in the preset time period. It is possible to generate the first user portrait and the second user portrait according to different trigger conditions. Moreover, since the real-time behavior data for generating the first user portrait and the second user portrait both correspond to the same target format and the first user portrait and the second user portrait are generated based on the target calculation strategy, it is possible to meet the real-time requirements of the short-term portrait and the comprehensiveness requirements of the long-term portrait based on a consistent data source and a unified processing process. At the same time, it also ensures the easy maintainability of the processing logic and the consistency of the long-term and short-term portraits.
[0120] Further, when generating the user portrait, for multiple real-time behavior data in the target data set, the label scores corresponding to the behavior tags with the same label content are accumulated to obtain the target score, and the target user portrait is generated according to each target score, which can visually indicate the behavior preferences of the target user in a digital way; by providing a query function, it is convenient to trace and query the behavior details, enabling developers to more easily understand the user portrait and locate the online problems of the user portrait.
[0121] The embodiments of the present invention also provide a user portrait generation device, as Figure 3 shown, including:
[0122] A first generation module 301, configured to, when receiving the generated current real-time behavior data when the target user uses the target application, generate a first user portrait for indicating the short-term behavior preferences of the target user based on the behavior tags corresponding to the real-time behavior data in the first time period and the current real-time behavior data according to the target calculation strategy, where the end time of the first time period is the first moment when the current real-time behavior data is obtained;
[0123] A second generation module 302, configured to, at the target moment, generate a second user portrait for indicating the long-term behavior preferences of the target user based on the behavior tags corresponding to the real-time behavior data in the second time period and the real-time behavior data in the preset time period according to the target calculation strategy, where the target moment is the moment with a preset time interval from the time when the second user portrait was last generated, the end time of the second time period is the start time of the preset time period, the end time of the preset time period is the target moment, and the duration of the preset time period is the preset time interval;
[0124] Wherein, the duration of the second time period is greater than the preset duration, and the duration of the second time period is greater than the duration of the first time period. The real-time behavior data used to generate the first user portrait and the second user portrait corresponds to the same target format, and the target calculation strategy is used to generate user portraits based on the real-time behavior data in the target format.
[0125] Optionally, the first generation module includes:
[0126] A first processing sub-module, configured to determine corresponding behavior tags according to current real-time behavior data, and obtain tag scores of the determined behavior tags based on the target calculation strategy;
[0127] A first update sub-module, configured to update the tag scores for the behavior tags corresponding to the real-time behavior data within the first time period according to the target calculation strategy;
[0128] A first generation sub-module, configured to generate a target user portrait according to the tag scores of the determined behavior tags and the updated tag scores, where the target user portrait is the first user portrait;
[0129] Wherein, each piece of real-time behavior data corresponds to at least one of the behavior tags, and the tag contents corresponding to different behavior tags are different.
[0130] Optionally, the second generation module includes:
[0131] A second processing sub-module, configured to determine corresponding behavior tags according to the real-time behavior data within the preset time period, and obtain tag scores of the determined behavior tags based on the target calculation strategy;
[0132] A second update sub-module, configured to update the tag scores for the behavior tags corresponding to the real-time behavior data within the second time period according to the target calculation strategy;
[0133] A second generation sub-module, configured to generate a target user portrait according to the tag scores of the determined behavior tags and the updated tag scores, where the target user portrait is the second user portrait;
[0134] Wherein, each piece of real-time behavior data corresponds to at least one of the behavior tags, and the tag contents corresponding to different behavior tags are different.
[0135] Optionally, the target calculation strategy is a strategy associated with behavior weights and time weights. The behavior weights are used to characterize the importance of the behaviors corresponding to the real-time behavior data, and the target calculation strategy includes a first calculation strategy and a second calculation strategy;
[0136] The first processing sub-module is further configured to:
[0137] When obtaining the label score of the behavior label corresponding to the current real-time behavior data, based on the first calculation strategy, determine the behavior weight and time weight of the behavior label corresponding to the current real-time behavior data, and determine the label score of the behavior label corresponding to the current real-time behavior data according to the behavior weight and time weight of the behavior label;
[0138] The second processing sub-module is further configured to:
[0139] When obtaining the label score of the behavior label corresponding to the real-time behavior data within the preset time period, based on the second calculation strategy, determine the behavior weight and time weight of the behavior label corresponding to the real-time behavior data within the preset time period, and determine the label score of the behavior label corresponding to the real-time behavior data within the preset time period according to the behavior weight and time weight of the behavior label;
[0140] Wherein, the calculation rules for calculating the label scores of the first calculation strategy and the second calculation strategy are the same. The first calculation strategy includes a first rule for determining the behavior weight and a second rule for determining the time weight. The second calculation strategy includes a third rule for determining the behavior weight and a fourth rule for determining the time weight. The time intervals between the collection time of the real-time behavior data and the first moment, and between the collection time of the real-time behavior data and the target moment are both negatively correlated with the time weight. The behavior weight and the time weight are both positively correlated with the label score.
[0141] Optionally, the first update sub-module is further configured to:
[0142] When updating the label score of the behavior label corresponding to the real-time behavior data within the first time period, based on the second rule included in the first calculation strategy, re-determine the time weight of the behavior label corresponding to the real-time behavior data within the first time period, and determine the corresponding label score according to the behavior weight of the behavior label corresponding to the real-time behavior data within the first time period and the re-determined time weight;
[0143] The second update sub-module is further configured to:
[0144] When updating the label score of the behavior label corresponding to the real-time behavior data within the second time period, based on the fourth rule included in the second calculation strategy, re-determine the time weight of the behavior label corresponding to the real-time behavior data within the second time period, and determine the corresponding label score according to the behavior weight of the behavior label corresponding to the real-time behavior data within the second time period and the re-determined time weight;
[0145] Among them, the behavior weights of the behavior tags corresponding to the real-time behavior data in the first time period are determined in advance based on the first rule, and the behavior weights of the behavior tags corresponding to the real-time behavior data in the second time period are determined in advance based on the third rule.
[0146] Optionally, the first generation sub-module or the second generation sub-module is further configured to:
[0147] In a target data set including multiple pieces of real-time behavior data, for the behavior tags with the same tag content, accumulate the corresponding tag scores to obtain a target score;
[0148] Generate the target user profile according to each of the target scores;
[0149] Among them, each target score corresponds to at least one behavior tag with the same tag content; the target data set includes the current real-time behavior data and the real-time behavior data in the first time period, or the target data set includes the real-time behavior data retained after data filtering in the preset time period and the real-time behavior data in the second time period.
[0150] Optionally, the device further includes:
[0151] A receiving and storing module, configured to receive the generated real-time behavior data when the target user performs various behaviors using the target application, and store the received real-time behavior data after converting it into the target format.
[0152] Optionally, the device further includes:
[0153] A first storage establishment module, configured to store the first user profile and establish a first association relationship between the first user profile and the corresponding real-time behavior data after generating the first user profile;
[0154] A second storage establishment module, configured to store the second user profile and establish a second association relationship between the second user profile and the corresponding real-time behavior data after generating the second user profile;
[0155] A first acquisition module, configured to, when receiving a first query request for querying the first user profile, in response to the first query request, acquire the corresponding real-time behavior data according to the first association relationship;
[0156] A second acquisition module, configured to, when receiving a second query request for querying the second user profile, in response to the second query request, acquire the corresponding real-time behavior data according to the second association relationship.
[0157] For the embodiments of the user profile generation device, since it is basically similar to the method embodiments, the description is relatively simple. For related parts, please refer to the partial description of the method embodiments.
[0158] An embodiment of the present invention also provides an electronic device, as Figure 4 shown, including a processor 41, a communication interface 42, a memory 43, and a communication bus 44. Among them, the processor 41, the communication interface 42, and the memory 43 complete mutual communication through the communication bus 44. The memory 43 is used to store a computer program; when the processor 41 executes the program stored on the memory 43, the following steps are implemented: when the target user uses the target application and receives the generated current real-time behavior data, based on the behavior tags corresponding to the real-time behavior data in the first period and the current real-time behavior data, a first user profile for indicating the short-term behavior preference of the target user is generated based on the target calculation strategy, and the end time of the first period is the first time when the current real-time behavior data is obtained; at the target time, based on the behavior tags corresponding to the real-time behavior data in the second period and the real-time behavior data in the preset period, a second user profile for indicating the long-term behavior preference of the target user is generated based on the target calculation strategy. The target time is the time when the time interval from the last generation of the second user profile is the preset duration. The end time of the second period is the start time of the preset period. The end time of the preset period is the target time, and the duration of the preset period is the preset duration; among them, the duration of the second period is greater than the preset duration, the duration of the second period is greater than the duration of the first period, the real-time behavior data used to generate the first user profile and the second user profile corresponds to the same target format, and the target calculation strategy is used to generate the user profile based on the real-time behavior data in the target format. When the processor 41 executes the program stored on the memory 43, other steps in the embodiments of the present invention can also be implemented.
[0159] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0160] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far away from the aforementioned processor.
[0161] The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0162] In another embodiment provided by the present invention, there is also provided a computer-readable storage medium storing instructions that, when run on a computer, cause the computer to execute the user profile generation method described in the above embodiment.
[0163] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to execute the user profile generation method described in the above embodiment.
[0164] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0165] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.
[0166] Each embodiment in this specification is described in a related manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.
[0167] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included within the protection scope of the present invention.
Claims
1. A method for generating a user profile, characterized in that, Including: When receiving the generated current real-time behavior data when the target user uses the target application, based on the behavior tags corresponding to the real-time behavior data in the first period and the current real-time behavior data, generate a first user portrait for indicating the short-term behavior preference of the target user based on the target calculation strategy, where the end time of the first period is the first time when the current real-time behavior data is obtained; At the target time, based on the behavior tags corresponding to the real-time behavior data in the second period and the real-time behavior data in the preset period, generate a second user portrait for indicating the long-term behavior preference of the target user based on the target calculation strategy, where the target time is the time when the time interval from the last time the second user portrait was generated is the preset duration, the end time of the second period is the start time of the preset period, the end time of the preset period is the target time, and the duration of the preset period is the preset duration; Wherein, the duration of the second period is greater than the preset duration, the duration of the second period is greater than the duration of the first period, the real-time behavior data used to generate the first user portrait and the second user portrait corresponds to the same target format, and the target calculation strategy is used to generate a user portrait based on the real-time behavior data in the target format; The generating a first user portrait for indicating the short-term behavior preference of the target user based on the behavior tags corresponding to the real-time behavior data in the first period and the current real-time behavior data based on the target calculation strategy includes: According to the current real-time behavior data, determine the corresponding behavior tags, and based on the target calculation strategy, obtain the tag scores of the determined behavior tags; For the behavior tags corresponding to the real-time behavior data in the first period, update the tag scores according to the target calculation strategy; Generate a target user portrait according to the tag scores of the determined behavior tags and the updated tag scores, where the target user portrait is the first user portrait; Wherein, each real-time behavior data corresponds to at least one of the behavior tags, and the tag contents corresponding to different behavior tags are different; The target calculation strategy is a strategy associated with behavior weights and time weights, the behavior weights are used to characterize the importance of the behaviors corresponding to the real-time behavior data, and the target calculation strategy includes a first calculation strategy; The obtaining the tag scores of the determined behavior tags based on the target calculation strategy includes: When obtaining the tag scores of the behavior tags corresponding to the current real-time behavior data, based on the first calculation strategy, determine the behavior weights and time weights of the behavior tags corresponding to the current real-time behavior data, and determine the tag scores of the behavior tags corresponding to the current real-time behavior data according to the behavior weights and time weights of the behavior tags; The first calculation strategy includes a first rule for determining the behavior weights and a second rule for determining the time weights.
2. The user portrait generation method according to claim 1, wherein The generating, based on the target calculation strategy and according to the behavior label corresponding to the real-time behavior data in the second time period and the real-time behavior data in the preset time period, the second user portrait indicating the long-term behavior preference of the target user comprises: Determine a corresponding behavior tag according to the real-time behavior data within the preset time period, and obtain a tag score of the determined behavior tag based on the target calculation strategy; For the behavior tags corresponding to the real-time behavior data in the second time period, updating the tag scores according to the target calculation strategy; Generate a target user portrait according to the determined label score of the behavior label and the updated label score, where the target user portrait is the second user portrait; Each piece of real-time behavior data corresponds to at least one of the behavior tags, and the tag contents corresponding to different behavior tags are different.
3. The user profile generation method according to claim 1, wherein The target calculation strategy also includes a second calculation strategy; When obtaining the label score of the behavior label corresponding to the real-time behavior data within the preset time period, based on the second calculation strategy, determine the behavior weight and time weight of the behavior label corresponding to the real-time behavior data within the preset time period, and determine the label score of the behavior label corresponding to the real-time behavior data within the preset time period according to the behavior weight and time weight of the behavior label; Among them, the calculation rules for calculating the label score of the first calculation strategy and the second calculation strategy are the same, the second calculation strategy includes a third rule for determining the behavior weight and a fourth rule for determining the time weight, the interval between the collection time of the real-time behavior data and the first time, and the interval between the collection time of the real-time behavior data and the target time are both negatively correlated with the time weight, and the behavior weight and the time weight are both positively correlated with the label score.
4. The user portrait generation method according to claim 3, wherein The updating of the label score according to the target calculation strategy includes: When updating the label score of the behavior label corresponding to the real-time behavior data within the first time period, based on the second rule included in the first calculation strategy, re-determine the time weight of the behavior label corresponding to the real-time behavior data within the first time period, and determine the corresponding label score according to the behavior weight of the behavior label corresponding to the real-time behavior data within the first time period and the re-determined time weight; When updating the label score of the behavior label corresponding to the real-time behavior data within the second time period, based on the fourth rule included in the second calculation strategy, re-determine the time weight of the behavior label corresponding to the real-time behavior data within the second time period, and determine the corresponding label score according to the behavior weight of the behavior label corresponding to the real-time behavior data within the second time period and the re-determined time weight; The behavior weight of the behavior tag corresponding to the real-time behavior data in the first time period is predetermined based on the first rule, and the behavior weight of the behavior tag corresponding to the real-time behavior data in the second time period is predetermined based on the third rule.
5. The user portrait generation method according to claim 3, wherein Generating a target user portrait according to the determined label score of the behavior label and the updated label score includes: In a target data set including multiple pieces of real-time behavior data, for the behavior tags with the same tag content, accumulate the corresponding tag scores to obtain a target score; Generate the target user portrait according to each of the target scores; Wherein, each of the target scores corresponds to at least one behavior tag with the same tag content; the target data set includes current real-time behavior data and real-time behavior data within the first time period, or the target data set includes real-time behavior data retained after data filtering within the preset time period and real-time behavior data within the second time period.
6. The user portrait generation method according to claim 1, wherein It further includes: When the target user performs various behaviors using the target application, receive the generated real-time behavior data, and convert the received real-time behavior data into the target format and then store it.
7. The user portrait generation method according to claim 1, wherein It further includes: After generating the first user portrait, store the first user portrait and establish a first association relationship between the first user portrait and the corresponding real-time behavior data; After generating the second user portrait, store the second user portrait and establish a second association relationship between the second user portrait and the corresponding real-time behavior data; When receiving a first query request for querying the first user portrait, in response to the first query request, obtain the corresponding real-time behavior data according to the first association relationship; When receiving a second query request for querying the second user portrait, in response to the second query request, obtain the corresponding real-time behavior data according to the second association relationship.
8. A user portrait generation device, characterized in that, It includes: A first generation module, configured to, when the target user uses the target application and the generated current real-time behavior data is received, generate a first user portrait for indicating the short-term behavior preference of the target user based on the behavior tags corresponding to the real-time behavior data within the first time period and the current real-time behavior data according to a target calculation strategy, where the end time of the first time period is the first time for obtaining the current real-time behavior data; A second generation module, configured to, at a target time, generate a second user portrait for indicating the long-term behavior preference of the target user based on the behavior tags corresponding to the real-time behavior data within the second time period and the real-time behavior data within the preset time period according to the target calculation strategy, where the target time is a time at an interval of a preset duration from the time when the second user portrait was last generated, the end time of the second time period is the start time of the preset time period, the end time of the preset time period is the target time, and the duration of the preset time period is the preset duration; Wherein, the duration of the second time period is greater than the preset duration, the duration of the second time period is greater than the duration of the first time period, the real-time behavior data used for generating the first user portrait and the second user portrait corresponds to the same target format, and the target calculation strategy is used to generate a user portrait based on the real-time behavior data in the target format. Generating a first user profile for indicating the short-term behavior preference of the target user based on the behavior tags corresponding to the real-time behavior data in the first time period and the current real-time behavior data, including: Determining the corresponding behavior tag according to the current real-time behavior data, and obtaining the tag score of the determined behavior tag based on the target calculation strategy; Updating the tag score according to the target calculation strategy for the behavior tags corresponding to the real-time behavior data in the first time period; Generating a target user profile according to the tag score of the determined behavior tag and the updated tag score, and the target user profile is the first user profile; Wherein, each real-time behavior data corresponds to at least one of the behavior tags, and the tag contents corresponding to different behavior tags are different.
9. An electronic device, characterized in that, Including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store computer programs; When the processor is used to execute the program stored on the memory, it realizes the steps in the user profile generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it realizes the steps in the user profile generation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Object recommendation method and device, computer equipment and storage medium
CN110941764A
Long-term and short-term user portrait generation method, device and equipment and readable storage medium
CN111444158A