Behavior event recommendation method and device and storage medium
By obtaining and analyzing the positive and negative behavior sequences of users, generating a set of frequent items and determining the frequency of occurrence, the problem of low recommendation accuracy caused by ignoring negative behavior in Word2Vec model is solved, and the accuracy of the recommendation system is improved.
Patent Information
- Application Number
- CN202411342677.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-10
AI Technical Summary
The existing Word2Vec model ignores negative behavior in user behavior modeling, resulting in low recommendation accuracy.
By obtaining the user-associated behavior sequence, including positive behavior sequence and negative behavior sequence, the positive behavior frequent item set and negative behavior frequent item set are generated based on the preset algorithm, the frequency of occurrence of frequent items is determined, and the recommended number is determined based on the score of frequent items Behavioral events.
The accuracy of behavioral event recommendations is improved, and the problem of low recommendation accuracy due to focusing only on positive behaviors is avoided, which increases the training data volume and computational complexity of the model.
Smart Images

Figure CN119292887A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and storage medium for recommending behavioral events. Background Art
[0002] At present, in the process of user behavior analysis in the field of data analysis, Word2Vec (Word to Vector) is generally used to model the user's behavior sequence, and then the useful information in the user's behavior is extracted through the model, which is used for the recommendation system to predict the user's next behavior and then generate a recommendation set. Therefore, the behavior used for modeling is the positive behavior sequence corresponding to the target event.
[0003] Since the Word2Vec model was originally designed to capture the semantic relationship between words in natural language processing, and the relationship between words is mainly reflected by co-occurrence (i.e., simultaneous appearance). Therefore, based on the principle of the model, when modeling the user's behavior sequence through Word2Vec, it will only model based on positive behaviors and ignore negative behaviors, resulting in low recommendation accuracy in the process of advancing some results that are affected by negative behaviors.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The present application provides a method, device and storage medium for recommending behavioral events, aiming to solve the technical problem of low accuracy of behavioral recommendations in related solutions.
[0006] To achieve the above purpose, the present application provides a method for recommending behavioral events, which includes the following steps:
[0007] Acquire a behavior sequence associated with the user, wherein the behavior sequence includes a positive behavior sequence and a negative behavior sequence;
[0008] Generate a positive behavior frequent item set corresponding to the positive behavior sequence and a negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm;
[0009] Determining frequent items that match the negative behavior frequent item set in the positive behavior frequent item set, and integrating the frequent items to obtain a target frequent item set;
[0010] The occurrence frequencies of the frequent items in the target frequent item set in the behavior sequence are determined, and the recommended behavior events are determined based on the occurrence frequencies.
[0011] In one embodiment, the step of obtaining the user's behavior sequence includes:
[0012] Identify target events;
[0013] Acquire the positive behavior sequence composed of events in a first time period, wherein the first time period is a time period from a first time node before the target event occurs to a time point when the target event occurs;
[0014] The negative behavior sequence constituted by events in a second time period is obtained, wherein the second time period is a time period from a second time node before the target event occurs to a target time point before the target event occurs.
[0015] In one embodiment, the duration of the first time period is equal to the duration of the second time period, the target time point in the second time period is the time point when a preset event occurs, and the preset event is a non-target event.
[0016] In one embodiment, the step of generating the positive behavior frequent item set corresponding to the positive behavior sequence and the negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm includes:
[0017] Determine preset support;
[0018] Acquire prefixes and prefix projections of the positive behavior sequence and the negative behavior sequence, and determine the number of each behavior in the positive behavior sequence and the negative behavior sequence according to the prefix projection;
[0019] The behaviors whose number is less than the preset support are removed, and the remaining behaviors are determined as the positive behavior sequence frequent item set and the negative behavior sequence frequent item set.
[0020] In one embodiment, the step of determining the occurrence frequency of the frequent items in the target frequent item set in the behavior sequence includes:
[0021] Determining a first frequency of the frequent item in the positive behavior sequence and a second frequency of the frequent item in the negative behavior sequence;
[0022] The first frequency and the second frequency are determined as the occurrence frequencies of the frequent items.
[0023] In one embodiment, the step of determining the recommended behavioral event based on the occurrence frequency includes:
[0024] Determining the score of the frequent item according to the first frequency and the second frequency, and calculating the scores of all frequent items in the target frequent item set to obtain a frequent item score set;
[0025] A target frequent item having a score higher than a preset threshold is determined in the frequent item score set, and the target frequent item is determined as the behavior event.
[0026] In one embodiment, before the step of obtaining the behavior sequence associated with the user, the method further includes:
[0027] Detecting and recording the user's operations in the interface;
[0028] All target behaviors of the user in the interface are determined according to the operation, and all the target behaviors are grouped into the behavior sequence and saved.
[0029] In one embodiment, after the step of determining all target behaviors of the user in the interface according to the operation, the method further includes:
[0030] identifying the semantics of at least one of the target behaviors;
[0031] Acquire a pre-stored semantic matching rule, and merge the target behaviors having synonymous semantics based on the semantic matching rule;
[0032] All the merged target behaviors are combined into the behavior sequence and saved.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a behavioral event recommendation device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the behavioral event recommendation method as described above.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the recommendation method for behavioral events as described above are implemented.
[0035] The present application provides a method for recommending behavioral events, a device for recommending behavioral events, and a storage medium, by obtaining a behavioral sequence associated with a user, the behavioral sequence including a positive behavioral sequence and a negative behavioral sequence, then generating a positive behavior frequent item set corresponding to the positive behavior sequence and a negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm, then determining frequent items matching the negative behavior frequent item set in the positive behavior frequent item set, integrating the frequent items to obtain a target frequent item set, and finally determining the frequency of occurrence of the frequent items in the target frequent item set in the behavioral sequence, and determining the recommended behavioral events based on the frequency of occurrence. The above method can improve the accuracy of behavioral event recommendation by determining the frequent items in the positive and negative behavioral sequences and the frequency of occurrence of the frequent items, and determining the recommended behavioral events based on the frequency of occurrence. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1 This is a flowchart of a first embodiment of a recommended method for behavioral events of this application;
[0039] Figure 2 This is a flow chart of a second embodiment of the recommended method for behavioral events of this application;
[0040] Figure 3 This is a sample data table of behavior sequences involved in the embodiment of the present application;
[0041] Figure 4 This is a flowchart of a third embodiment of the recommended method for behavioral events of this application;
[0042] Figure 5 This is a flowchart of a fourth embodiment of the recommended method for behavioral events of this application;
[0043] Figure 6 This is a schematic diagram of the architecture of the hardware operating environment of a device for recommending behavioral events involved in an embodiment of the present application.
[0044] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0046] In order to better understand the above technical solution, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0047] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0048] The main solution of the present application is: obtaining a user-associated behavior sequence, the behavior sequence including a positive behavior sequence and a negative behavior sequence; generating a positive behavior frequent item set corresponding to the positive behavior sequence and a negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm; determining frequent items matching the negative behavior frequent item set in the positive behavior frequent item set, and integrating the frequent items to obtain a target frequent item set; determining the occurrence frequency of the frequent items in the target frequent item set in the behavior sequence, and determining recommended behavior events based on the occurrence frequency.
[0049] At present, in the process of user behavior analysis in the field of data analysis, Word2Vec (Word to Vector) is generally used to model the user's behavior sequence, and then the useful information in the user's behavior is extracted through the model, which is used for the recommendation system to predict the user's next behavior and then generate a recommendation set. Therefore, the behavior used for modeling is the positive behavior sequence corresponding to the target event.
[0050] Since the Word2Vec model was originally designed to capture the semantic relationship between words in natural language processing, and the relationship between words is mainly reflected by co-occurrence (i.e., simultaneous appearance). Therefore, based on the principle of the model, when modeling the user's behavior sequence through Word2Vec, it will only model based on positive behaviors and ignore negative behaviors, resulting in low recommendation accuracy in the process of advancing some results that are affected by negative behaviors.
[0051] By obtaining a user-associated behavior sequence, the behavior sequence includes a positive behavior sequence and a negative behavior sequence, then generating a positive behavior frequent item set corresponding to the positive behavior sequence and a negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm, then determining frequent items matching the negative behavior frequent item set in the positive behavior frequent item set, integrating the frequent items to obtain a target frequent item set, and finally determining the frequency of occurrence of the frequent items in the target frequent item set in the behavior sequence, and determining the recommended behavior event based on the frequency of occurrence. The above method can improve the accuracy of behavior event recommendation by determining frequent items in positive and negative behavior sequences and the frequency of occurrence of frequent items, and determining the recommended behavior event based on the frequency of occurrence.
[0052] It should be noted that the execution subject of this embodiment can be an event recommendation system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a behavior event recommendation device that can achieve the above functions, etc. This embodiment does not specifically limit this. The following takes the event recommendation system as an example of the execution subject to illustrate this embodiment and the following embodiments.
[0053] Embodiment 1
[0054] Please refer to Figure 1 In the first embodiment, the method for recommending behavioral events includes the following steps:
[0055] Step S10: Acquire a behavior sequence associated with the user, wherein the behavior sequence includes a positive behavior sequence and a negative behavior sequence;
[0056] In this embodiment, the processing action is performed by the event recommendation system, and the behavior sequence may include the behavior triggered by the user in the interface provided by the front end of the event recommendation system. The user's behavior operations are counted in real time through the detection tool. The events that constitute the user's behavior sequence in the event recommendation system may be the user's product click behavior, purchase behavior or other landmark events, thereby obtaining the user's behavior sequence, wherein the behavior sequence includes the positive behavior sequence and the negative behavior sequence.
[0057] Step S20: determining a positive behavior sequence frequent item set and a negative behavior sequence frequent item set of the behavior sequence based on a preset algorithm;
[0058] In this embodiment, the behavior sequence includes a positive behavior sequence and a negative behavior sequence, and a positive behavior sequence frequent item set of the positive behavior sequence and a negative behavior sequence frequent item set corresponding to the negative behavior sequence are determined based on a preset algorithm, wherein the preset algorithm may be a PrefixSpan algorithm, which is an algorithm for mining sequence patterns and an association rule mining algorithm.
[0059] As an optional implementation, the preset algorithm may also be the FP-Growth algorithm, which is used to mine frequent item sets. The core idea of the FP-Growth algorithm is to store the relevant information of frequent item sets by constructing a compact data structure, the FP tree, and then query the frequent item sets by traversing the tree structure.
[0060] Specifically, the specific steps of determining the frequent item set of the positive behavior sequence and the frequent item set of the negative behavior sequence of the behavior sequence by the FP-Growth algorithm are as follows: first scan and read the behavior sequence, and count the number of occurrences of each single behavior. According to the minimum support threshold, filter out the frequent item set. Then create an empty root node, and for each behavior in the behavior sequence, insert it into the FP tree in descending order according to the preset support of the item set. If the corresponding path already exists in the tree, increase the count on the path. If not, create a new path. When inserting the behavior into the FP tree, it is also necessary to update the head pointer table and record each frequent item and its linked list in the FP tree. Finally, for each frequent item, construct all complete paths containing the frequent item through the linked list in the head pointer table. From then on, a new FP tree can be constructed for each frequent item based on its conditional pattern. In this way, starting from the root node of the conditional FP tree, recursively mine frequent items, and for each frequent item, find all patterns containing the item through the conditional FP tree. Recursively perform the same operation on other frequent items to determine the frequent item set of the positive behavior sequence and the frequent item set of the negative behavior sequence of the behavior sequence.
[0061] Optionally, in this embodiment, the step of determining a positive behavior sequence frequent item set and a negative behavior sequence frequent item set of the behavior sequence by PrefixSpan includes:
[0062] Determine a preset support; obtain prefixes and prefix projections of the positive behavior sequence and the negative behavior sequence, and determine the number of each behavior in the positive behavior sequence and the negative behavior sequence according to the prefix projection; remove the behavior whose number is less than the preset support, and determine the remaining behaviors as the positive behavior frequent item set and the negative behavior frequent item set.
[0063] Specifically, the preset support is calculated, and the specific calculation method is determined according to the ratio of the number of sequences in the sequence pattern to the total number of sequences in the data set, wherein the number of sequences in the sequence pattern refers to the number of sequences containing the specific event to be determined in the total sequence, and the total number of sequences in the data set is the number of behavior sequences. There are multiple supports, and the minimum support is selected as the preset support. First, a single behavior is used as a prefix, so that the prefix projection associated with the behavior can be determined. The prefix projection is displayed in the form of a sequence, and the number of occurrences of the behavior in the prefix projection of the positive behavior sequence and the negative behavior sequence is traversed, and the behavior whose number is less than the preset support is removed. Then, the frequent sequence corresponding to the prefix of length 2 is mined, and another prefix projection is determined with the prefix, and the traversal and removal of the behavior whose number in the prefix projection is less than the preset support is continued, and the prefix projection database of a certain prefix is empty. At this time, the frequent item set of the positive behavior sequence and the frequent item set of the negative behavior sequence in the prefix projection are counted.
[0064] Optionally, determine the prefix projection of a prefix, and scan each data record from the beginning. If it is not a prefix, delete the element. If the element is the same as the prefix, delete the element. For example, at this time, take row a as the prefix, scan the first sequence record ad, and get a single prefix projection of a as _d, with the underscore as a placeholder, and then start scanning the next data record. That is, scan the data record from the beginning. If the first element is the same as prefix a, and it is found that the item set where a is located has 2 or more elements (that is, ad is in the same item set), then after deleting a, use a placeholder underscore to replace the position of a.
[0065] For example, assuming the prefix is a, find the prefix projection of the sequence {(ef)(ab)(df)(c)(b)}. First scan the sequence to the position a in the sequence, delete the behavior before the position and the behavior at the position, and get {(_b)(df)(c)(b)}, which is the prefix projection of the above sequence.
[0066] Step S30: determining frequent items that match the negative behavior frequent item set in the positive behavior frequent item set, and integrating the frequent items to obtain a target frequent item set;
[0067] In this embodiment, after the positive behavior sequence frequent item set and the negative behavior sequence frequent item set are mined based on a preset algorithm, a set is created, and the positive behavior frequent items in the positive behavior frequent item set are matched with the negative behavior frequent items in the negative behavior frequent item set through a character matching algorithm, and the matched positive behavior frequent items and negative frequent items are output as frequent items. Finally, all the matched frequent items are integrated into the created set, and the set is named the target frequent item set.
[0068] As an optional implementation method, a script can also be designed by programming to achieve the intersection of the positive behavior frequent item set and the negative behavior frequent item set. By calling the function for solving the intersection in the preset function library and integrating it into the script, in the actual solving process, the positive behavior frequent item set and the negative behavior frequent item set are input into the script as input data, and the script calls the intersection solving function and outputs the intersection of the positive behavior frequent item set and the negative behavior frequent item set, which is the target frequent item.
[0069] Step S40: determining the occurrence frequency of the frequent items in the target frequent item set in the behavior sequence, and determining the recommended behavior event based on the occurrence frequency.
[0070] In this embodiment, after the frequent item set of the positive behavior sequence and the frequent item set of the negative behavior sequence are merged, the merged target frequent item set is obtained, and a counting algorithm is called to count the occurrence frequency of the target frequent item set in the positive and negative behavior sequences, and the frequent item with a high user click rate is determined according to the occurrence frequency of the target frequent item set in the positive and negative behavior sequences, and the frequent item is determined as a recommended behavior event.
[0071] Optionally, in this embodiment, the step of counting the occurrence frequency of the target frequent item set in the behavior sequence includes:
[0072] Determine a first frequency of the target frequent item set in the positive behavior sequence and a second frequency in the negative behavior sequence; and determine the first frequency and the second frequency as the occurrence frequency of the target frequent item set.
[0073] Specifically, a counting algorithm is called to count the frequency of occurrence of the target frequent item set in the positive and negative behavior sequences. The number of occurrences of each frequent item in the target frequent item set in the positive behavior sequence is determined one by one through the counting algorithm, and then the first frequency is determined according to the ratio of the number of occurrences to the number of sequences in the positive behavior sequence. Similarly, the number of occurrences of each frequent item in the target frequent item set in the negative behavior sequence is determined one by one through the counting algorithm, and the second frequency is determined according to the ratio of the number of occurrences to the number of sequences in the negative behavior sequence. It can be understood that the counting algorithm is a method involving counting elements in a data set, including sliding window counting and basic counting, etc., which can be used to count the number of occurrences of frequent items in positive and negative behavior sequences, which are not limited here.
[0074] Further, in this embodiment, the step of determining the recommended behavior event based on the occurrence frequency includes:
[0075] Determine the scores of frequent items according to the first frequency and the second frequency, and count the scores of all frequent items in the target frequent item set to obtain a frequent item score set; determine the target frequent items with scores higher than a preset threshold in the frequent item score set, and determine the target frequent items as the behavior events.
[0076] Specifically, the score is the ratio of the occurrence frequency of a frequent item in the positive behavior sequence to the occurrence frequency in the negative behavior sequence, that is, the significance degree of the frequent item set is obtained according to the ratio on the positive and negative behavior sequences, and this significance degree is the above-mentioned score. By statistically calculating the significance degrees (scores) of all frequent items in the positive and negative behavior sequences, a frequent item score set is obtained. The preset threshold is a manually set significance threshold, which is a hyperparameter of the processing module in the system and is set as needed specifically, and is not limited here. When the score of the frequent item is higher than the preset threshold, it indicates that the frequency of the frequent item appearing in the positive behavior sequence is significantly greater than that in the negative behavior sequence; on the contrary, it indicates that the frequency of the frequent item appearing in the negative behavior sequence is significantly greater than that in the positive behavior sequence.
[0077] Exemplarily, first define score as the frequent item score set, FS as the frequency of the frequent item in the positive behavior sequence, FQ as the frequency of the frequent item in the negative behavior sequence, and Func as the frequency statistical function. Then traverse the frequent items in the merged target frequent item set, calculate the significance scores of all frequent items and add them to the set score. First, statistically calculate the frequency FS of the frequent item in the positive behavior sequence, FS = Func(i, S), i ∈ U, where i identifies the frequent item, S identifies the positive behavior sequence, and U represents the merged target frequent item set, and statistically calculate the frequency FQ of the frequent item in the negative behavior sequence, F Q = Func(i, Q), i ∈ U, and Q represents the negative behavior sequence. Then calculate the significance score score according to the ratio of the frequencies of the frequent item in the positive and negative behavior sequences, and then obtain the set of significance scores, score = score ∪ {scorei}. The above obtains all frequent items U and their corresponding scores through the two-way sequence mining algorithm. Let the significance score corresponding to the frequent item i be scorei, and the significance threshold is manually set as t (hyperparameter). When scorei ≥ t, it indicates that the frequency of the frequent item appearing in the positive behavior sequence is significantly greater than that in the negative behavior sequence. When the frequent item i appears in the user behavior sequence, the probability that the user has a target event is relatively high; when scorei < t, it indicates that the probability that the user has a target event is relatively low. Therefore, according to the defined threshold t, we can finally obtain a set of significant item scores model that promotes the occurrence of the target event for the user, model = {scorei ∈ U|scorei > t}. According to this formula, the frequent items corresponding to the significant item scores with significant scores greater than the threshold t can be screened out, so as to determine the recommended behavior events.
[0078] In the technical solution provided in this embodiment, by obtaining the behavior sequence associated with the user, the behavior sequence includes a positive behavior sequence and a negative behavior sequence, then based on a preset algorithm, a positive behavior frequent item set corresponding to the positive behavior sequence and a negative behavior frequent item set corresponding to the negative behavior sequence are generated, and then the frequent items matching the negative behavior frequent item set are determined in the positive behavior frequent item set, and the frequent items are integrated to obtain a target frequent item set, and finally the frequency of occurrence of the frequent items in the target frequent item set in the behavior sequence is determined, and the recommended behavior events are determined based on the frequency of occurrence. Compared with the related schemes that extract user behavior sequences through Word2Vec modeling, only focusing on the user's positive and positive behaviors (such as clicks, purchases, etc.), if negative behaviors are introduced, the amount of training data and the computational complexity of the model will be greatly increased. Since negative behaviors are usually far more than positive behaviors, this will lead to an extension of the model training time, and may also increase the risk of overfitting of the model. The solution of this embodiment can generate frequent items and the frequency of occurrence of frequent items in positive and negative behavior sequences through a preset algorithm, and determine the recommended behavior events based on the frequency of occurrence, thereby improving the accuracy of behavior event recommendation.
[0079] Embodiment 2
[0080] Please refer to Figure 2 In the second embodiment, the step of obtaining the behavior sequence associated with the user includes:
[0081] Step S50: determining a target event;
[0082] In this embodiment, the target event is a specific event predicted or analyzed, such as a user's purchase of a product, a user's completion of an activity or task, and a user's subscription service. It can be a target event selected by an administrator based on the operation interface, or it can be a target event output by the model after analyzing recent events operated by users.
[0083] Step S60: Acquire the positive behavior sequence composed of events in a first time period, wherein the first time period is a time period from a first time node before the target event occurs to a time point when the target event occurs;
[0084] Step S70: Acquire the negative behavior sequence constituted by events in a second time period, wherein the second time period is a period between a second time node before the target event occurs and a target time point before the target event occurs.
[0085] In this embodiment, the first time period is pre-set, corresponding to the time period from the first time node before the target event occurs to the time point when the target event occurs, that is, from the time point when the user operates the target event to the first time node before the target event occurs. All behaviors generated by the user during this period are regarded as positive behavior sequences. Similarly, the second time period is the time period from the second time node before the target event occurs to the target time point when the target event does not occur. That is, from the time point when the user does not operate the target event to the second time node before the target event occurs, all behaviors generated by the user during this period are regarded as negative behavior sequences.
[0086] As an optional implementation method for obtaining behavior sequences, behavior sequences can be obtained by means of a web crawler. By using a preset library to send a request to obtain the content of a web page and application, and then parsing the page and application, determining the source and target of the data to be crawled, such as the website URL, the data field to be crawled, etc., extracting the required elements according to the crawling requirements, integrating the crawled data into a behavior sequence and saving it in the database, as shown in the following example. Figure 3 As shown, Figure 3 This is a sample data table of behavior sequences involved in the embodiment of the present application.
[0087] Optionally, in this embodiment, the duration of the first time period is equal to the duration of the second time period, and the target time point in the second time period is the time point at which a preset event occurs. The target time point in the second time period is the time point at which a preset event occurs, which means that a non-target event is selected as the preset event, and the period from the second time before the preset event occurs to the target time point at which the preset event occurs is the second time period.
[0088] Exemplarily, the time period may be in days or weeks. Here, in days, all first behavior sequences of users in the N days before the target event occurs are selected as the positive behavior sequences, and all second behavior sequences of users in the N days before the target event occurs are selected as the negative behavior sequences. In addition, the user generates a series of behavior sequences, such as ABCBGABGF, by using the application in the terminal, and the behavior sequence in the embodiment is obtained by obtaining the above sequence.
[0089] Embodiment 3
[0090] Please refer to Figure 4 In the third embodiment, before the step of obtaining the behavior sequence associated with the user, wherein the behavior sequence includes a positive behavior sequence and a negative behavior sequence, the step further includes:
[0091] Step S80: Detect and record the user's operations in the interface.
[0092] Step S90: determining all target behaviors of the user in the interface according to the operation, and grouping all the target behaviors into the behavior sequence and saving the sequence.
[0093] In this embodiment, the processing action is performed by a data capture module set in the event recommendation system. The data capture module can capture all operations of the user in the interface, including mouse clicks, keyboard keys, and touch events of the touch screen, and then determine the controls clicked by the user and the behavior of the operation based on these operations, and determine them as the target behavior, that is, analyze these operations of the user and identify the specific operations performed by the user on the interface. For example, if it is detected that the left mouse button is clicked on a button, it can be recorded as a click event, and the specific service clicked by the user is recorded. Finally, these target behaviors are sorted in a sequence to generate a behavior sequence. In addition, it is also necessary to obtain the timestamps of the user when performing these operations, and then sort the user's target behaviors according to the timestamps to generate a behavior sequence.
[0094] Optionally, a data model can be set in the data capture module to describe the user's behavior. The data model includes user ID, operation type (such as click, slide, etc.), operation object (such as button, text box, etc.), operation timestamp, and operation result. The API (Application Programming Interface) is used to capture the events corresponding to the user's operation, so that the user's behavior sequence can be quickly analyzed and saved through the data model.
[0095] Optionally, in this embodiment, after the step of determining all target behaviors of the user in the interface according to the operation, the method further includes:
[0096] Identify the semantics of at least one of the target behaviors; obtain pre-stored semantic matching rules, and merge the target behaviors with synonymous semantics based on the semantic matching rules; and form all the merged target behaviors into the behavior sequence and save it.
[0097] Specifically, the semantics of the target behavior is identified by a natural language processing algorithm, and one or more semantic tags are assigned to the identified target behavior. Then, a pre-stored semantic matching rule is obtained, which contains the relationship between different semantic tags, and then the synonymous semantic tags are determined by the semantic matching rule, and the corresponding target behavior is determined according to the determined semantic tags, and these synonymous target behaviors are merged to unify the target behaviors into one behavior. It should be understood that the merger here does not delete other synonymous target behaviors, but changes the identifiers of synonymous target behaviors in the sequence, such as unifying the target behaviors such as "purchase", "order" and "settlement" into "purchase". The semantic matching rules here can use pre-stored semantic matching rules to determine whether behaviors with the same or similar semantics can be merged. If two or more behaviors have the same semantic tags, they can be regarded as synonymous behaviors and merged. The specific merging process is as described above and will not be repeated here. Finally, the processed target behaviors are sorted according to timestamps to form a behavior sequence and saved in the database.
[0098] As an optional implementation, different synonyms can be mapped to a standard term. Similar behaviors can be encoded or grouped to reduce the types of behaviors and make the generated behavior sequence data uniform. Synonyms can also be matched and replaced by regular expressions, and synonyms can be matched according to pre-written regular expressions to merge the same items.
[0099] Furthermore, in this embodiment, after the step of determining all target behaviors of the user in the interface according to the operation, the method further includes:
[0100] Identify and determine abnormal behavior in the target behavior, wherein the abnormal behavior includes invalid behavior records and erroneous timestamps; and remove the abnormal behavior in the target behavior.
[0101] Specifically, abnormal behaviors are identified through machine learning methods, such as invalid click records, wrong timestamps, etc. The target behaviors are cleaned by deleting or correcting the wrong target behaviors. The wrong target behaviors can be corrected by feeding back the abnormal behaviors to the management terminal, and the staff can conduct a second review; or the target behavior can be re-tested and recorded, and then the two can be compared to obtain the correct target behavior. For time series data, linear interpolation or other interpolation methods can be used to fill in missing values. In addition, abnormal behaviors also include users not being able to trigger two different behaviors at the same time.
[0102] In the technical solution provided in this embodiment, by detecting and recording the user's operations in the interface, then determining all target behaviors of the user in the interface based on the operations, and organizing all the target behaviors into the behavior sequence and saving them, the efficiency of obtaining the behavior sequence can be improved.
[0103] Embodiment 4
[0104] Please refer to Figure 5 In the fourth embodiment, as Figure 5 As shown, Figure 5 This is a flow chart of the fourth embodiment of the present application. After obtaining the positive behavior sequence and the negative behavior sequence, define the positive behavior sequence as S = {s1, s2, s3...sn}, and the negative behavior sequence Q = {s1, s2, s3...sn}. Use the Prefixspan algorithm for the positive and negative behavior sequences respectively, mine the frequent items in the corresponding data sets to obtain the positive behavior sequence frequent item set P = {i1, i2, i3...in} and the negative behavior sequence frequent item set N = {i1, i2, i3...in}. Then merge the positive behavior sequence frequent item set and the negative behavior sequence frequent item set to obtain the target frequent item set, and call the counting algorithm to count the frequency of occurrence of the frequent item set in the positive and negative behavior sequences, and obtain its significance based on the difference (ratio) of the frequent item set in the positive and negative behavior sequences, and then determine the significance as the significance item score, and finally determine the recommended behavior event based on the significance item score and the threshold, thereby completing the recommendation process of the behavior event.
[0105] Since the system introduced in the embodiment of the present application is a system used to implement the method of the embodiment of the present application, based on the method introduced in the embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the embodiment of the present application belong to the scope of protection of this application.
[0106] The present application provides a device for recommending behavioral events, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for recommending behavioral events in the above-mentioned embodiment 1.
[0107] Reference below Figure 6, which shows a schematic diagram of the structure of a device suitable for implementing a behavior event recommendation in an embodiment of the present application. The behavior event recommendation device in an embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The recommended device for the behavioral event shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0108] like Figure 6 As shown, the behavior event recommendation device may include a processing device 1001 (e.g., a core processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the behavior event recommendation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the behavior event recommendation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows the behavior event recommendation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0109] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0110] The behavior event recommendation device provided by the present application adopts the behavior event recommendation method in the above embodiment, which can solve the technical problem of low accuracy of behavior recommendation in related solutions. Compared with the prior art, the beneficial effects of the behavior event recommendation device provided by the present application are the same as the beneficial effects of the behavior event recommendation method provided by the above embodiment, and the other technical features in the behavior event recommendation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0111] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0112] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0113] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the method for recommending behavioral events in the above-mentioned embodiment.
[0114] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, systems or devices or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0115] The computer-readable storage medium may be included in the behavior event recommendation device; or may exist independently without being incorporated into the behavior event recommendation device.
[0116] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a behavior event recommendation device, the behavior event recommendation device: obtains a behavior sequence associated with a user, wherein the behavior sequence includes a positive behavior sequence and a negative behavior sequence; generates a positive behavior frequent item set corresponding to the positive behavior sequence and a negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm; determines frequent items matching the negative behavior frequent item set in the positive behavior frequent item set, and integrates the frequent items to obtain a target frequent item set; determines the occurrence frequency of the frequent items in the target frequent item set in the behavior sequence, and determines the recommended behavior events based on the occurrence frequency.
[0117] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0118] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0119] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0120] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for recommending behavioral events, and can solve the technical problem of low accuracy of behavioral recommendations in related solutions. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for recommending behavioral events provided by the above-mentioned embodiments, and will not be elaborated here.
[0121] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for recommending behavioral events when executed by a processor.
[0122] The computer program product provided by this application can solve the technical problem of low accuracy of behavior recommendation in related solutions. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of this application are the same as the beneficial effects of the behavior event recommendation method provided by the above embodiment, which will not be repeated here.
[0123] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A method for recommending behavioral events, characterized in that: The method comprises the following steps: Acquire a behavior sequence associated with the user, wherein the behavior sequence includes a positive behavior sequence and a negative behavior sequence; Generate a positive behavior frequent item set corresponding to the positive behavior sequence and a negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm; Determining frequent items that match the negative behavior frequent item set in the positive behavior frequent item set, and integrating the frequent items to obtain a target frequent item set; The occurrence frequencies of the frequent items in the target frequent item set in the behavior sequence are determined, and the recommended behavior events are determined based on the occurrence frequencies.
2. The method according to claim 1, characterized in that The step of obtaining the user's behavior sequence includes: Identify target events; Acquire the positive behavior sequence composed of events in a first time period, wherein the first time period is a time period from a first time node before the target event occurs to a time point when the target event occurs; The negative behavior sequence constituted by events in a second time period is obtained, wherein the second time period is a time period from a second time node before the target event occurs to a target time point before the target event occurs.
3. The method according to claim 2, characterized in that The duration of the first time period is equal to the duration of the second time period, and the target time point in the second time period is the time point when a preset event occurs.
4. The method according to claim 1, characterized in that The step of generating the positive behavior frequent item set corresponding to the positive behavior sequence and the negative behavior frequent item set corresponding to the negative behavior sequence based on a preset algorithm includes: Determine preset support; Acquire prefixes and prefix projections of the positive behavior sequence and the negative behavior sequence, and determine the number of each behavior in the positive behavior sequence and the negative behavior sequence according to the prefix projection; The behaviors whose number is less than the preset support are removed, and the remaining behaviors are determined as the positive behavior sequence frequent item set and the negative behavior sequence frequent item set.
5. The method according to claim 1, characterized in that The step of determining the occurrence frequency of the frequent items in the target frequent item set in the behavior sequence comprises: Determining a first frequency of the frequent item in the positive behavior sequence and a second frequency of the frequent item in the negative behavior sequence; The first frequency and the second frequency are determined as the occurrence frequencies of the frequent items.
6. The method according to claim 5, characterized in that The step of determining the recommended behavioral event based on the occurrence frequency comprises: Determining the score of the frequent item according to the first frequency and the second frequency, and calculating the scores of all frequent items in the target frequent item set to obtain a frequent item score set; A target frequent item having a score higher than a preset threshold is determined in the frequent item score set, and the target frequent item is determined as the behavior event.
7. The method according to claim 1, characterized in that Before the step of obtaining the behavior sequence associated with the user, the method further includes: Detecting and recording the user's operations in the interface; All target behaviors of the user in the interface are determined according to the operation, and all the target behaviors are grouped into the behavior sequence and saved.
8. The method according to claim 7, characterized in that After the step of determining all target behaviors of the user in the interface according to the operation, the method further includes: identifying the semantics of at least one of the target behaviors; Acquire a pre-stored semantic matching rule, and merge the target behaviors having synonymous semantics based on the semantic matching rule; All the merged target behaviors are combined into the behavior sequence and saved.
9. A device for recommending behavioral events, characterized in that: The behavior event recommendation device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the behavior event recommendation method as claimed in any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for recommending behavioral events as described in any one of claims 1 to 8 are implemented.